<%--
  Created by IntelliJ IDEA.
  User: 杨铭
  Date: 2022/6/6
  Time: 9:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<style>
    .div{
        background-color: antiquewhite;
        border-radius: 20px;
        box-shadow: 0 20px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
        padding: 80px 50px;
        text-align: center;
        max-width: 100%;
        width: 600px;
        margin:0 auto;
        margin-top: 40px;
    }
</style>
<head>
    <title>Title</title>
</head>
<body style="background-color: bisque">
<h1 style="color:gold;font-family: 'Century Gothic';font-size: 30px;text-align: center;margin-top: 50px">Please Add Information</h1>
<div class="div">
    <form action="/regist" method="get" >
        <input type="text" name="id" id="ID" style="color: darksalmon "><h4 id="goodsid" style="font-size: 10px; color: blueviolet">请输入登录账号</h4>
        <input type="password" id="password" name="password" style="color: darksalmon"><h4 id="goodsname" style="font-size: 10px;color: blueviolet">请输入登录密码</h4>

        <input type="submit" ><button class="btn" style="margin-left: 40px"><a href="login.jsp" >返回登录界面</a></button>
    </form>

</div>
</body>
<script>

    // ID.onchange= function (){
    //
    //     var ID = this.value;
    //
    //     var reg = /^\d{6,10}$/;
    //
    //     if(reg.test(ID)){
    //
    //     }else{
    //
    //         alert("账号格式不正确");
    //
    //     }
    // }

    password.onchange = function(){

        var password = this.value;

        var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,12}$/;

        if(reg.test(password)){

        }else{

            alert("密码格式不正确，必须是梳子家字母的格式");

        }

    }

</script>
</html>

